package com.common.utils;/**
 * @author JunYu
 * @create 2022-08-16--16:45
 */

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: B2BPSSMSystem
 *
 * @description: 日期相关工具类
 *
 * @author: JunYu
 *
 * @create: 2022-08-16 16:45
 **/

public class DateUtils {
    public static String generateCurrentTimeInString(){
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String currentTime = simpleDateFormat.format(date);
        //Date类型转String类型
        try {
            Date d = simpleDateFormat.parse(currentTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return currentTime;
    }
}
